package com.smz.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class PageController {


    @RequestMapping("/page/{page}.html")
    public String comm(@PathVariable("page") String page){
        return page;
    }

    @RequestMapping("/page/{path}/{page}.html")
    public String comm(@PathVariable("path") String path,@PathVariable("page") String page){
        return path +"/"+page;
    }


    @RequestMapping("/page/toPrint/{page}.html")
    public String commModel(@PathVariable("page") String page, @RequestParam("orderId")String orderId, Model model){
        model.addAttribute("orderId",orderId);
        return "produce/"+page;
    }
}
